# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kdiff3
pkgver=1.9.6
pkgrel=0
# armhf blocked by extra-cmake-modules
# s390x, riscv64 blocked by polkit -> kparts
arch="all !armhf !s390x !riscv64"
url="https://apps.kde.org/kdiff3/"
pkgdesc="A file and folder diff and merge tool"
license="GPL-2.0-or-later "
makedepends="
	boost-dev
	extra-cmake-modules
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdoctools-dev
	ki18n-dev
	kparts-dev
	kwidgetsaddons-dev
	qt5-qtbase-dev
	samurai
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/kdiff3/kdiff3-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
0b12d0b81cdeeccf38248ca468ae714b7baadccce658cac41e619e960f865cff5e7362c78bf67b80037f3f4c763c123dd2aa65bb32567a3bd8f56e7158d72dbf  kdiff3-1.9.6.tar.xz
"
